package objectsandclasses;

/**
 * author: seshumadhav@gmail.com
 */
public class MyClone implements Cloneable {
	
	private final int id;
	
	public MyClone(int id) {
		this.id = id;
	}
	
	public int getId() {
		return id;
	}

	//  Either do this or implement cloneable
	//	@Override
	//	public Object clone() {
	//		return this;
	//	}

	public static void main(String[] args) throws CloneNotSupportedException {
		MyClone mc = new MyClone(1);
		System.out.println("Id set into mc: " + mc.getId());

		MyClone nmc = (MyClone) mc.clone();
		System.out.println("Id set into nmc: " + nmc.getId());
	}

}
